<template>
  <!-- vue3组件中的模板结构可以没有根标签div -->
  <div class="Child">
    <h3>我是Child组件</h3>
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Child",
  async setup() {
    let sum = ref(0);
    let p = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({ sum });
      }, 1000);
    });
    return await p;
  },
};
</script>

<style>
.Child {
  background-color: skyblue;
  padding: 10px;
}
</style>
